﻿#region Copyright
//————————————————————————————————————————//
//	创建人员(Creator)    ：Huangyd
//	创建日期(Date)       ：2012-07-14
//  联系方式(Email)      ：aj-ayumi@163.com; gajayumi@gmail.com; ajayumi@me.com
//  描    述(Description)：
//
//	Copyright (C) 2012 ajayumi 版权所有
//————————————————————————————————————————//
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Drawing2D;
using System.Drawing;

namespace  ajayumi.develop.CSharp.Controls.Forms
{
    public class AntiAliasGraphics : IDisposable
    {
        private SmoothingMode m_OldMode;
        private Graphics m_Graphics;

        public AntiAliasGraphics(Graphics graphics)
        {
            m_Graphics = graphics;
            m_OldMode = graphics.SmoothingMode;
            graphics.SmoothingMode = SmoothingMode.AntiAlias;
        }

        #region IDisposable 成员

        public void Dispose()
        {
            m_Graphics.SmoothingMode = m_OldMode;
        }

        #endregion
    }
}
